package com.xyh.springboot.model;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

/**
 * @Author:kyle
 * @Date:2020/12/28 - 11:29
 * @Project:springboot
 * @Package:com.xyh.springboot.model
 * @Version:1.0
 */
@Data
public class UserDTO {

    private Integer userPkid;
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[a-z]{5,10}$",message ="用户名必须小写，5-10位")
    private String username;
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^[0-9]{6}$",message = "密码只能是数字，长度为6位")
    private String password;
    @Pattern(regexp = "^[\u4e00-\u9fa5]{2,10}$",message = "用户昵称必须是中文在2-10个字符之间")
    private String nickname;

    private LocalDateTime regTime;
}
